package com.frxuexi.base.utils

import java.util.concurrent.ConcurrentHashMap


object LiveDataBus {

    val map=ConcurrentHashMap<String,SingleLiveEvent<Any>>()

    fun <T> with(key:String):SingleLiveEvent<T>{
        if(!map.containsKey(key)){
            map[key]=SingleLiveEvent()
        }
        return map[key] as SingleLiveEvent<T>
    }
}